<?php

/**
 * Capital Direct Lending (http://www.philbsd.com/cdl)
 *
 * Copyright (C) 2008 Philippine Business Solution Developers <http://www.philbsd.com>
 * All rights reserved.
 *
 *
 * LICENSE
 *
 * This source file is subject to the GNU General Public License v3 license
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@philbsd.com so we can send you a copy immediately.
 *
 * @copyright  (c) 2008 Philippine Business Solution Developers. (http://www.philbsd.com)
 * @license    http://www.gnu.org/licenses/gpl-3.0.txt
 * @version    $Id: index.phtml 42 2008-03-12 10:05:35Z philbsd $
 */

if (isset($this->message)) {
	echo $this->escape($this->message) . "<br />\n";
}

?>
<a href="<?php echo $this->baseUrl; ?>/admin/user/add">Add</a>
<script type="text/javascript">
function go(u) {
  window.location=u;
  return false;
};
</script>
<table cellpadding="2" cellspacing="2" border="1">
	<tr>
		<th>Id</th>
		<th>Username</th>
		<th>Role</th>
		<th>Name</th>
		<th>Email</th>
		<th>&nbsp;</th>
	</tr>
<?php

if (isset($this->records)) {
	foreach ($this->records as $record) {
		echo "
	<tr>
		<td onclick=\"return go(&#39;{$this->baseUrl}/admin/user/view/id/{$record['id']}&#39;);\">
			{$record['id']}
		</td>
		<td onclick=\"return go(&#39;{$this->baseUrl}/admin/user/view/id/{$record['id']}&#39;);\">
			{$record['username']}
		</td>
		<td onclick=\"return go(&#39;{$this->baseUrl}/admin/user/view/id/{$record['id']}&#39;);\">
			{$record['role']}
		</td>
		<td onclick=\"return go(&#39;{$this->baseUrl}/admin/user/view/id/{$record['id']}&#39;);\">
			{$record['last_name']}, {$record['first_name']} {$record['middle_name']}
		</td>
		<td onclick=\"return go(&#39;{$this->baseUrl}/admin/user/view/id/{$record['id']}&#39;);\">
			{$record['email']}
		</td>
		<td>
			<a href=\"{$this->baseUrl}/admin/user/edit/id/{$record['id']}\">Edit</a> |
			<a href=\"{$this->baseUrl}/admin/user/delete/id/{$record['id']}\">Delete</a>
		</td>
	</tr>";
		//print_r($record);
	}
}

?>
</table>